package com.xucy.springboot.designmodel.behavioral.interpreter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author xucy
 * @Date 2019-10-31 17:31
 * @Description
 **/

public class Context {

    private Map<Expression, Integer> map = new HashMap<>();

    //定义变量
    public void add(Expression s, Integer value){
        map.put(s, value);
    }
    //将变量转换成数字
    public int lookup(Expression s){
        return map.get(s);
    }
}
